package com.sa.web.front.action;

import java.io.FileInputStream;
import java.io.InputStream;
import java.io.UnsupportedEncodingException;
import java.net.URLDecoder;
import java.util.List;

import javax.servlet.ServletContext;

import net.sf.json.JSONArray;

import org.apache.struts2.ServletActionContext;

import com.opensymphony.xwork2.ActionContext;
import com.opensymphony.xwork2.ActionSupport;
import com.sa.web.bean.StuDetailBeanView;
import com.sa.web.dao.service.StuDetailDao;
import com.sa.web.util.Page;
import com.sa.web.util.Util;

public class StuInfoAction extends ActionSupport {

	/**
	 * 
	 */
	private static final long serialVersionUID = 5403882223609346563L;

	private StuDetailDao stuDetailDao;
	
	private StuDetailBeanView stuDetail;

	private List<StuDetailBeanView> stuDetailList;

	/** easyUi对象 */
	private JSONArray rows;
	/** 信息总数 */
	private JSONArray total;

	public String findStuDetailList() throws Exception {
		 stuDetailList = stuDetailDao.queryStuDetail(stuDetail, Page.getStarIndex(),Page.getPreIndex());
		 rows = JSONArray.fromObject(stuDetailList);
		 System.out.println(rows);
		 total = JSONArray.fromObject(stuDetailDao.queryStuDetailCount(stuDetail));
		 return Util.jSONSuccess();
	}

	public StuDetailDao getStuDetailDao() {
		return stuDetailDao;
	}

	public void setStuDetailDao(StuDetailDao stuDetailDao) {
		this.stuDetailDao = stuDetailDao;
	}

	public JSONArray getRows() {
		return rows;
	}

	public JSONArray getTotal() {
		return total;
	}

	public StuDetailBeanView getStuDetail() {
		return stuDetail;
	}
	
	public void setStuDetail(StuDetailBeanView stuDetail) {
		this.stuDetail = stuDetail;
	}



	public List<StuDetailBeanView> getStuDetailList() {
		return stuDetailList;
	}

	public void setStuDetailList(List<StuDetailBeanView> stuDetailList) {
		this.stuDetailList = stuDetailList;
	}

}
